package com.andeveloper.springdemo.controller;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.andeveloper.springdemo.service.cache.MemcachedClientService;

@Controller
@RequestMapping("/")
public class HomePageController {
	private static final Logger logger = LoggerFactory.getLogger(HomePageController.class);
	@Resource
	private MemcachedClientService memcachedClientService;
	@RequestMapping(value={"/","/home"})
	public String index() {
		memcachedClientService.set("name", 10, "admin");
		String name = (String) memcachedClientService.get("name");
		logger.info(name);
		return "index";
	}
}
